package ms.maplestory.boot.client.character.Inventory;

import ms.maplestory.boot.enums.BaseStatType;
import lombok.Getter;
import lombok.Setter;
import ms.maplestory.boot.enums.ItemOptionType;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class ItemOption {

    private int id;
    private int optionType;
    private int reqLevel;

    private Map<Integer, Map<BaseStatType, Double>> statValuesPerLevel = new HashMap<>();
    private Map<Integer, Map<ItemOptionType, Integer>> miscValuesPerLevel = new HashMap<>();

    public void addStatValue(int level, BaseStatType baseStatType, double value) {
        Map<BaseStatType, Double> valMap = statValuesPerLevel.getOrDefault(level, new HashMap<>());
        valMap.put(baseStatType, value);
        statValuesPerLevel.put(level, valMap);
    }

    public void addMiscValue(int level, ItemOptionType type, int value) {
        Map<ItemOptionType, Integer> valMap = miscValuesPerLevel.getOrDefault(level, new HashMap<>());
        valMap.put(type, value);
        miscValuesPerLevel.put(level, valMap);
    }

    @Override
    public String toString() {
        return "id: " + id + ", optionType: " + optionType;
    }
}
